<template>
  <div class="search">
    <f-form ref="form" :action="api.viproom" :form-key="this.formItem.viproomId" >
      <f-form-item label="营业时间"  name="roomTime" dataType="${formField.dataType}"   :value="formItem.roomTime" />
      <f-form-item label="营业起时间"  name="startTime" dataType="${formField.dataType}"   :value="formItem.startTime" />
      <f-form-item label="营业止时间"  name="endTime" dataType="${formField.dataType}"   :value="formItem.endTime" />
      <f-form-item label="是否需要预约（1不需要，2需要）"  name="isAppoint" dataType="number"   :value="formItem.isAppoint" />
      <f-form-item label="贵宾厅类型（1机场贵宾厅，2高铁贵宾厅）"  name="viproomType" dataType="number"   :value="formItem.viproomType" />
      <f-form-item label="贵宾厅分类"  name="viproomCategory" dataType="number"   :value="formItem.viproomCategory" />
      <f-form-item label="贵宾厅简介"  name="roomDesc" dataType="${formField.dataType}"   :value="formItem.roomDesc" />
      <f-form-item label="贵宾厅地址"  name="roomAddress" dataType="${formField.dataType}"   :value="formItem.roomAddress" />
      <f-form-item label="贵宾厅电话"  name="roomPhone" dataType="${formField.dataType}"   :value="formItem.roomPhone" />
      <f-form-item label="机场Id"  name="airportId" dataType="${formField.dataType}"   :value="formItem.airportId" />
      <f-form-item label="高铁Id"  name="highSpeedTrainId" dataType="${formField.dataType}"   :value="formItem.highSpeedTrainId" />
      <f-form-item label="排序"  name="viproomSort" dataType="number"   :value="formItem.viproomSort" />
      <f-form-item label="预约控制"  name="maxTime" dataType="number"   :value="formItem.maxTime" />
      <f-form-item label="是否含有贵宾通道"  name="iscontain" dataType="number"   :value="formItem.iscontain" />
      <f-form-item label="儿童规定"  name="childrensRule" dataType="${formField.dataType}"   :value="formItem.childrensRule" />
      <f-form-item label="贵宾通道名称"  name="viponlyName" dataType="${formField.dataType}"   :value="formItem.viponlyName" />
      <f-form-item label=""  name="isTakePeople" dataType="number"   :value="formItem.isTakePeople" />
      <f-form-item label=""  name="securityType" dataType="number"   :value="formItem.securityType" />
      <f-form-item label="（1国内出发/2国际出发）"  name="departType" dataType="number"   :value="formItem.departType" />
      <f-form-item label="使用时长"  name="canUseHours" dataType="${formField.dataType}"   :value="formItem.canUseHours" />
      <f-form-item label="航站楼信息"  name="terminalInfo" dataType="${formField.dataType}"   :value="formItem.terminalInfo" />
      <f-form-item label=""  name="appointmentStartTime" dataType="${formField.dataType}"   :value="formItem.appointmentStartTime" />
      <f-form-item label=""  name="appointmentEndTime" dataType="${formField.dataType}"   :value="formItem.appointmentEndTime" />
      <f-form-item label="推荐购卡的卡种"  name="recommendVipcardId" dataType="${formField.dataType}"   :value="formItem.recommendVipcardId" />
    </f-form>
  </div>
</template>
<script>
  import api from './js/api'
  export default {
    name: 'viproomForm',
    props: {},
    data() {
      return {
        refs:this.$refs,
        api:  Object.assign(api, this.api),
        isAdd: true,//是否是添加模式
        loaded: false,//是否加载完成
        formItem: this.getFormItem()
      }
    },
    methods: {
      getFormItem() {
        return {
          viproomId: '',
          roomTime: '',
          startTime: '',
          endTime: '',
          isAppoint: '',
          viproomType: '',
          viproomCategory: '',
          roomDesc: '',
          roomAddress: '',
          roomPhone: '',
          airportId: '',
          highSpeedTrainId: '',
          viproomSort: '',
          maxTime: '',
          iscontain: '',
          childrensRule: '',
          viponlyName: '',
          isTakePeople: '',
          securityType: '',
          departType: '',
          canUseHours: '',
          terminalInfo: '',
          appointmentStartTime: '',
          appointmentEndTime: '',
          recommendVipcardId: ''
        }
      },
      //表单赋值
      setData(data) {
        this.$refs.form.resetFields()
        this.formItem = this.getFormItem()
        if (data && data.viproomId) {
          let params={
              viproomId:data.viproomId
          }
          this.refs['form'].getDetails(params,(data)=>{
             this.formItem=data
             this.loaded = true
          })
          this.isAdd = false
        } else {
          this.loaded = true
        }
      },
      //提交表单
      handleSubmit(callback) {
        this.$refs.form.submit({  }, callback)
      }
    },
    created() {
    },
    components: {}
  }
</script>

<style scoped lang="less" rel="stylesheet/less">

</style>
